package com.tuzhi.common.structure;

import java.util.LinkedList;

public class SetList<T> extends LinkedList<T> {

    private static final long serialVersionUID = 3612971767507405567L;

    @Override
    public boolean add(T object){
        if(size() == 0){
            return super.add(object);
        }else{
            if(!this.contains(object)) {
                return super.add(object);
            }
        }
        return false;
    }

    public boolean addLastObj(T object) {
        if(size() == 0){
        }else{
            if(this.contains(object)) {
               this.remove(object);
            }
        }
        return super.add(object);
    }
}
